import { axiosInstance } from '@/http';
import { ILoginRequest, ILoginResponse } from './type';
import { user } from '@/model/api/user';

/**
 * @description: 用户登录
 * @param {ILoginRequest} 参数
 * @returns {Promise}
 */
export const login = (params: ILoginRequest): Promise<ILoginResponse> =>
  axiosInstance.post(user.login, params);

/**
 * @description 退出登录
 * @returns void
 */
export const logout = (): Promise<ILoginResponse> =>
  axiosInstance.get(`${user.logout}`);
